export const parseJson = function(jsonObj, key) {
  // 循环所有键
  let item = {}
  jsonObj.forEach((element) => {
    if (element.dataIndex == key) {
      item = element
    }
  })
  return item
}

//数组深拷贝方法
export const deepCopy = function(obj) {
  if (typeof obj !== "object") return
  var newObj = obj instanceof Array ? [] : {}
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      newObj[key] = typeof obj[key] === "object" ? deepCopy(obj[key]) : obj[key]
    }
  }
  return newObj
}
